package com.ukao.steward.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.ukao.steward.R;
import com.ukao.steward.base.ListBaseAdapter;
import com.ukao.steward.base.SuperViewHolder;
import com.ukao.steward.bean.StoreBean;
import com.ukao.steward.util.CheckUtils;

import java.util.List;

import static android.media.CamcorderProfile.get;

/**
 * Created by ukaodev on 2017/8/24.
 */

public class SelectStoreAdapter extends ListBaseAdapter<StoreBean> {




    public SelectStoreAdapter(Context context, List<StoreBean> mHomeBean) {
        super(context, mHomeBean);
    }

    @Override
    public int getLayoutId() {
        return R.layout.adapter_select_store_item;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder,final int position) {
        StoreBean item = getItem(position);
        TextView serveName = holder.getView(R.id.store_name);
        ImageView payImage = holder.getView(R.id.pay_image);
        serveName.setText(CheckUtils.isEmptyString(item.getName()));
        if (item.isCheck()){
            payImage.setVisibility(View.VISIBLE);
            holder.itemView.setBackgroundResource(R.drawable.shape_payorder_blue);
        }else{
            payImage.setVisibility(View.GONE);
            holder.itemView.setBackgroundResource(R.drawable.shape_select_store_gray);
        }



    }

}
